import Vue from 'vue'
import Vuex from 'vuex'
import userStore from './modules/userStore'
import addressStore from './modules/addressStore'
import maintainerStore from './modules/maintainerStore'
import adminStore from './modules/adminStore'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
  },
  getters: {
    // 获取token
    getToken (state) {
      return state.userStore.userInfo.token
    },
    getMaintainerToken (state) {
      return state.maintainerStore.maintainerInfo.MAINTAINER_TOKEN
    },
    getAdminToken (state) {
      return state.adminStore.adminInfo.ADMIN_TOKEN
    }
  },
  mutations: {
  },
  actions: {
  },
  modules: {
    userStore,
    addressStore,
    maintainerStore,
    adminStore
  }
})
